
import glob
import os
from scripts.build_support import *

Import ('*')

files = glob.glob (env['rootdir'] + 'src/mos/sys/*.c')
file_list = strip_path_from_files (files)

if env['debug'] == '1':
    no_debug_list = ['main.c']
    
    debug_file_list = []
    for myfile in file_list:
        newfile = myfile.replace('.c','.debug.c')

        if listfind(myfile, no_debug_list):
            newfile = myfile
        else:
            env.Default(env.Debug(newfile, myfile))
        debug_file_list.append(newfile)
    sys = env.Library('sys', debug_file_list)
else:
    sys = env.Library ('sys', file_list)
env.Default(sys)
